<template>
  <transition name="fade">
    <div v-if="visible" id="fffffffffffffffff-message" class="fffffffffffffffff-shade">
      <div id="fffffffffffffffff-content" class="fffffffffffffffff-content">
        <div class="fffffffffffffffff-mb">
          <div class="ffff-content" :class="'fffffffffffffffff-' + type">{{ content }}<i v-if="type === 'success'" class="el-icon-success fffffffffffffffff-icon" />
            <i v-else-if="type === 'warning'" class="el-icon-warning fffffffffffffffff-icon" />
            <i v-else class="el-icon-error fffffffffffffffff-icon" />
          </div>
        </div>
      </div>
    </div>
  </transition>
</template>

<script>
export default {
  name: 'MyMessage',
  data() {
    return {
      content: '',
      time: 1500,
      visible: false,
      type: 'success'
    }
  },
  mounted() {
    this.close()
  },
  methods: {
    close() {
      setTimeout(() => {
        this.visible = false
      }, this.time)
    }
  }
}
</script>
<style lang="scss">
  .fffffffffffffffff-shade{
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255,0.71);
    z-index: 3000;
  }
  .fffffffffffffffff-content{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    border-radius: 50px;
    padding: 10px 20px;
    text-align: center;
  }
  .ffff-content{
    color: #fff;
    border-radius: 20px;
    padding: 12px 23px;
    display: inline-block;
    box-sizing: border-box;
    line-height: 1;
    font-size: 14px;
    font-weight: 400;
    outline: none;
    margin: 0;
    transition: .1s;
        white-space: nowrap;
  }
  .fffffffffffffffff-success{
    background-color: #67c23a;
    border-color: #67c23a;
  }
  .fffffffffffffffff-error{
    background-color: #F56C6C;
    border-color: #F56C6C;
  }
  .fffffffffffffffff-warning{
    background-color: #E6A23C;
    border-color: #E6A23C;
  }
  .fffffffffffffffff-mb{
    margin-bottom: 10px;
  }
  .fffffffffffffffff-icon{
    margin-left: 8px;
  }
</style>
